<?php
	header("Content-type: text/html; charset=utf-8");
	define('ALLOWGUEST',true);
	session_start();
	require_once './source/core/run.php';
	
	require_once './data/ajax/functions.php';
	require_once 'data/include/Cart.class.php';
	$cart = new Cart();
	$inputNum = $_POST['inputNum'];
	$sid = $_POST['sid'];		
	
	$data = array(
		'sid'=>$sid,// 唯一 sid，添加购物车时自动生成
		'num'=>$inputNum
	);
	$cart->update($data);
	$infoNum = $_SESSION['cart']['total_rows'];
			$infoTotalPrice = $_SESSION['cart']['total'];
			$info = $_SESSION['cart']['goods'][$sid];
			$info['TotalPrice'] =$infoTotalPrice;
			$info['goodsNum'] = $infoNum;
			echo json_encode($info);
			
			die;
	
	
?>
